﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lilium.LParse.Memoization
{
    public struct MemoizedResult
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="position">Position after parser application</param>
        /// <param name="result">Parse result</param>
        /// <param name="failed">true if parser failed, otherwise false</param>
        /// <param name="exceptedValues">Excepted parse values</param>
        public MemoizedResult(long position, object result, bool failed, IEnumerable<object> exceptedValues)
        {
            m_ExceptedValues = exceptedValues;
            m_Failed = failed;
            m_Position = position;
            m_Result = result;
        }

        #region public object ExceptedValues

        private IEnumerable<object> m_ExceptedValues;

        public IEnumerable<object> ExceptedValues
        {
            get
            {
                return m_ExceptedValues;
            }
            set
            {
                m_ExceptedValues = value;
            }
        }

        #endregion

        #region public bool Failed

        private bool m_Failed;

        public bool Failed
        {
            get
            {
                return m_Failed;
            }
            set
            {
                m_Failed = value;
            }
        }

        #endregion

        #region public long Position

        private long m_Position;

        public long Position
        {
            get
            {
                return m_Position;
            }
            set
            {
                m_Position = value;
            }
        }

        #endregion

        #region public object Result

        private object m_Result;

        public object Result
        {
            get
            {
                return m_Result;
            }
            set
            {
                m_Result = value;
            }
        }

        #endregion
    }
}